#include "uti_indexseries.h"




IndexSeries::IndexSeries(IndexSerInfo* pIndexserinfo)
{
	memcpy(&m_indexserinfo, pIndexserinfo, sizeof(m_indexserinfo));

	m_pmemman = new MemMan<IndexData>(m_indexserinfo.sersize, m_indexserinfo.p);

	m_pmemman->InitUnitPointer(&m_pindexcur, &m_indexindex);

}

IndexSeries::~IndexSeries()
{
	if (NULL != m_pmemman)
	{
		delete m_pmemman;
	}
}


void IndexSeries::Addindex(int index)
{

	if (m_pindexcur->changeflag != 0) 
	{
		m_pmemman->NextUnitPointer(&m_pindexcur,&m_indexindex);//get cur bar pointer and index
	}

	m_pindexcur->changeflag++;

	m_pindexcur->index = index;

}



